import React, { Fragment } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom'
import { Provider } from 'react-redux'
import {renderRoutes, matchRoutes} from 'react-router-config'
import routes from '../routes'
import Header from '../containers/header/index.js'
import { getClientStore } from '../store'
// hydrate 把服务端 未完成的 工作，浏览器来完成。比如事件绑定
console.log(module.hot, 'module.hot')

ReactDOM.render(
    <Provider store={getClientStore()}>
        <BrowserRouter>
            {/* <Fragment>
                <Header /> */}
                {renderRoutes(routes)}
                {/* {routes.map((item) => {
                    return <Route {...item} />
                })} */}
            {/* </Fragment> */}
        </BrowserRouter>
    </Provider>, document.getElementById('root'))
